/* GUI CONVERTED from rwwrmt.p (converter v1.75) Sat Aug 12 23:18:39 2000 */
/* rwwrmt.p - WORKCENTER ROUTING STANDARDS MAINTENANCE                  */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/*F0PN*/ /*V8:ConvertMode=Maintenance                                   */
/*K1Q4*/ /*V8:RunMode=Character,Windows                                 */
/* REVISION: 2.0      LAST MODIFIED: 03/19/87   BY: EMB */
/* REVISION: 4.0      LAST MODIFIED: 02/24/88   BY: RL  *A171**/
/* REVISION: 8.6      LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */


/* DISPLAY TITLE */
{mfdtitle.i "b+ "}

define variable del-yn like mfc_logical initial no.

/* DISPLAY SELECTION FORM */

/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
wcr_wkctr      colon 30
   wcr_mch        colon 30
   wc_desc        no-label
   wcr_part       colon 30
   pt_desc1       no-label
   wcr_op         colon 30
   ro_desc        no-label skip(1)
   wcr_rate       colon 30
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/* DISPLAY */
view frame a.
mainloop:
repeat with frame a:
/*GUI*/ if global-beam-me-up then undo, leave.


   prompt-for wcr_wkctr wcr_mch wcr_part wcr_op editing:

      /* FIND NEXT/PREVIOUS RECORD */
      {mfnp.i wcr_route wcr_wkctr wcr_wkctr wcr_mch wcr_mch wcr_route}

      if recno <> ? then do:
     display wcr_wkctr wcr_mch wcr_part wcr_op wcr_rate.
     find wc_mstr where wc_wkctr = wcr_wkctr and wc_mch = wcr_mch
     no-lock no-error.
     if available wc_mstr then display wc_desc.
     else display " " @ wc_desc.
     find pt_mstr where pt_part = wcr_part no-lock no-error.
     if available pt_mstr then display pt_desc1.
     else display " " @ pt_desc1.
     find ro_det where ro_routing = wcr_part and ro_op = integer(wcr_op)
     no-lock no-error.
     if available ro_det then display ro_desc.
     else display " " @ ro_desc.
      end.
   end.

   find wc_mstr where wc_wkctr = input wcr_wkctr and wc_mch = input wcr_mch
   no-lock no-error.
   if available wc_mstr then display wc_desc.
   else display " " @ wc_desc.
   find pt_mstr where pt_part = input wcr_part no-lock no-error.
   if available pt_mstr then display pt_desc1.
   else display " " @ pt_desc1.
   find ro_det where ro_routing = input wcr_part
   and ro_op = integer(input wcr_op) no-lock no-error.
   if available ro_det then display ro_desc.
   else display " " @ ro_desc.

   if not available ro_det then do:
      {mfmsg.i 126 2}
   end.

   /* ADD/MOD/DELETE  */
   find wcr_route using wcr_wkctr and wcr_mch and
   wcr_part and wcr_op no-error.
   if not available wcr_route then do:
      {mfmsg.i 1 1}
      create wcr_route.
      assign wcr_wkctr wcr_mch wcr_part wcr_op.
   end.

   recno = recid(wcr_route).
   display wcr_rate.

   ststatus = stline[2].
   status input ststatus.
   del-yn = no.

   set wcr_rate editing:

      readkey.

      /* DELETE */
      if lastkey = keycode("F5") or
     lastkey = keycode("CTRL-D")
      then do:

     del-yn = yes.
     {mfmsg01.i 11 1 del-yn}
     if del-yn then leave.
      end.
      else apply lastkey.
   end.
   if del-yn then do:
      delete wcr_route.
      clear frame a.
/*GUI*/ RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
      del-yn = no.
   end.
end.
/*GUI*/ if global-beam-me-up then undo, leave.

status input.
